package day22;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class ChatServer {
	public static void main(String[] args) throws Exception {
		ServerSocket ss = new ServerSocket(10222);
		Socket s = ss.accept();
		BufferedReader br = new BufferedReader(new InputStreamReader(s
				.getInputStream()));
		PrintWriter pw = new PrintWriter(s.getOutputStream());
		while (true) {
			String str = br.readLine();
			pw.println(str);
			pw.flush();
		}
	}
}
